#ifndef __GEOMETRY_H__
#define __GEOMETRY_H__
#include "mesh.h"
#include "vec_core.h"

class GeometryGenerator {
public:
    static Mesh CreateCylinder(
        float bottomRadius, float topRadius, 
        float height, std::uint32_t sliceCount, 
        std::uint32_t stackCount) 
    {
        Mesh mesh;
        float stackHeight = height / stackCount;
        std::uint32_t ringCount = stackCount + 1;
        for (std::uint32_t i = 0; i < ringCount; ++i) {
            float y = lerp(-0.5f * height, 0.5f * height, (float)i / ringCount);
            float r = lerp(bottomRadius, topRadius, (float)i / ringCount);
            for (std::uint32_t j = 0; j <= sliceCount; ++j) {
                float theta = lerp(0.0f, 2 * Constant::Pi, (float)j / sliceCount);
                Vec3f pos;
                pos.x = r * cosf(theta);
                pos.y = y;
                pos.z = r * sinf(theta);
                TexCoord texCoord;
                texCoord.u = (float)j / sliceCount;
                texCoord.v = 1.0f - (float)i / stackCount;
                
            }
        }
    }
private:

};

#endif